package com.tsing.basic.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tsing.basic.mapper.Log2Mapper;
import com.tsing.basic.service.ILogService;
import com.tsing.basic.vo.req.IdsReqVo;
import com.tsing.basic.vo.req.LogPageReqVo;
import com.tsing.basic.vo.resp.LogRespVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author TheTsing
 * @version 1.0
 * @date 2021/4/22 11:34
 */
@Service
public class LogServiceImpl implements ILogService {

    @Resource
    private Log2Mapper log2Mapper;

    @Override
    public void deleteLog(IdsReqVo reqVo) {
        log2Mapper.deleteLog(reqVo.getIds());
    }

    @Override
    public Page<LogRespVo> logPage(LogPageReqVo reqVo) {
        Page<LogRespVo> page = new Page<>(reqVo.getPageNum(), reqVo.getPageSize());
        List<LogRespVo> list = log2Mapper.logPage(reqVo, page);
        page.setRecords(list);//当前页数据
        return page;
    }

}
